using System;
using System.Data;
using System.Data.SqlClient;


/// <summary>
/// Summary description for SQLServerClass
/// </summary>
public partial class SQLServerClass
{
    private string connectionString = "";
    public string ConnectionString
    {
        set { connectionString = value; }
        get { return connectionString; }
    }
    private string errorMessage = "";
    public string ErrorMessage
    {
        set { errorMessage = value; }
        get { return errorMessage; }
    }
    private int errorCode = 0;
    public int ErrorCode
    {
        set { errorCode = value; }
        get { return errorCode; }
    }
    public SQLServerClass()
    {
        connectionString = "server=(local);" +
            "database=RecruitVietnamDb;" +
            "Integrated Security=SSPI;";
    }
    public SQLServerClass(string conString)
    {
        connectionString = conString;
    }
    void OpenConnection()
    {
        sqlConnection = new SqlConnection();
        sqlConnection.ConnectionString = connectionString;
        sqlConnection.Open();
    }
    void CloseConnection()
    {
        if (sqlConnection.State != ConnectionState.Open)
        {
            sqlConnection.Close();
        }
        sqlConnection.Dispose();
    }

    SqlConnection sqlConnection;
    SqlCommand sqlCommand;
    SqlDataReader sqlDataReader;
}
